package com.rabbit;

import org.springframework.amqp.rabbit.annotation.EnableRabbit;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

import java.io.IOException;

/**
 * @author CKC
 * @date 2022/12/25 11:17
 */
@SpringBootApplication
@EnableRabbit
public class RabbitMQSpringBootApplication {
    public static void main(String[] args) throws InterruptedException, IOException {
        ConfigurableApplicationContext run = SpringApplication.run(RabbitMQSpringBootApplication.class, args);
        demo_test bean = run.getBean(demo_test.class);
        //while (true){
        //for (int i = 0; i < 10; i++) {
        bean.demo1();
        //}
        Thread.sleep(1000L);
        //}

    }
}
